package com.summer.data.jql.concept.func;

import com.summer.data.Jsql;
import com.summer.data.dialect.Dialect;
import com.summer.data.jql.Context;
import com.summer.data.jql.concept.Field;

/**
 * @author 345480567@qq.com
 */
public class Nvl<T> implements Field<T> {

    public Field field;

    public Field<T> result;

    public Field<T> other;

    public Nvl(Field field, Field result) {
        this.field = field;
        this.result = result;
    }

    public Nvl(Field field, Field result, Field other) {
        this.field = field;
        this.result = result;
        this.other = other;
    }

    @Override
    public Jsql toFieldSql(Context ctx, Dialect dialect) {
        return dialect.getNvlJsql(ctx, this);
    }
}
